<?php defined('BASEPATH') OR exit('No direct script access allowed');

if (!function_exists('menu_active'))
{

	function menu_active($class = NULL)
	{
		$ci = & get_instance();		
		$module = $ci->module ? $ci->module : "home";
		//controller or class
		if(!empty($class)){
			$module = $class;
		}
		if($module != 'page'){
		$ci->template
			->append_metadata("<script type=\"text/javascript\">
				$().ready(function(){
					active_menu('".$module."');
				});
				</script>");
		}
	}

}